import React from 'react';
import axios from 'axios';

class OperatorList extends React.Component {
  constructor(props) {
    super(props);
    console.log(this.props)
    this.state = {
      date: new Date()
    };
  }

  render() {
    const {text, onChangeText, onButtonClick} = this.props;
    return (
      <div>
        <span>It is : {this.state.date.toLocaleTimeString()}.</span>
        <h1 onClick={onChangeText}> {text} </h1>
        <button onClick={onButtonClick}>click me</button>
      </div>
    );
  }

  componentDidMount() {
    // axios.get("/api/test/operator/list").then(res => {
    //   console.log(res)
    //   this.setState({products: res.data})
    // }).catch(err => {
    //   console.log(err)
    // })
  }
}

export default OperatorList;